<template>
	<view>
		<view class="uni-px-5 uni-pb-5 type">
			<!-- <view class="text">举报类型：{{JSON.stringify(checkbox1)}}</view> -->
			<view class="text">举报类型</view>
			<uni-data-checkbox :multiple="false" v-model="checkbox1" :localdata="hobby" @change="change"></uni-data-checkbox>
			
		</view>
		<button @click="submit">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checkbox1: [0],
				type_text:'',//钓点内容
				radio1: 0,
				id:0,//钓点id
				hobby: [{
							text: '钓点虚假',
							value: 0
						}, {
							text: '定位偏差',
							value: 1
						}, {
							text: '视频很差',
							value: 2
						}, {
							text: '详情不符',
							value: 3
						}],
			};
		},
		onLoad(opt) {
			this.id = opt.id
			console.log('optjubao111',opt)
		},
		methods:{
			change(e){
				this.type_text = e.detail.data.text
				console.log('change2322',this.checkbox1,e,this.type_text)
			},
			submit(){
				// encodeURIComponent()
				console.log('submit111',this.type_text)
				this.$api.get("my/jubao",{id:this.id,type_text:this.type_text}).then( res =>{
					uni.showToast({
						title:res.msg
					})
					setTimeout(()=>{
						uni.switchTab({
							url:"/pages/tabs/my"
						})
					},2000)
				})
			}
		}
	}
</script>

<style lang="scss">
	.type{
		margin: 27rpx;
		padding: 27rpx;
		background-color: #fff;
		background: #FFFFFF;
		border-radius: 20rpx;
	}
	.text{
		margin-bottom: 20rpx;
	}
	button{
		height: 87rpx;
		line-height: 87rpx;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #333333;
		margin: 40rpx 27rpx 0;
		background: #3681F3;
		border-radius: 13rpx;
		font-weight: 500;
		font-size: 29rpx;
		color: #FFFFFF;
		margin-top: 120rpx;
	}
</style>
